fix(@angular/cli): isolate temporary package installation from parent pnpm workspace#33303
Conversation
330ac84 to
391eab3
Compare
There was a problem hiding this comment.
Code Review
This pull request prevents pnpm from traversing up the directory tree and modifying the project's workspace lockfile by writing a blank pnpm-workspace.yaml in the temporary directory. It also updates the mock host, adds unit tests, and introduces an E2E test to verify the fix. The review feedback suggests simplifying the unit tests by configuring the MockHost with the required directory structure directly in its constructor, which avoids manual spying on host.stat and type casting.
391eab3 to
eb893b9
Compare
alan-agius4
left a comment
There was a problem hiding this comment.
LGTM, though maybe in this case we should avoid generating a lockfile for temp installations.
|
On second thought, this might introduce a few regressions:
|
… pnpm workspace Write an empty pnpm-workspace.yaml file inside the temporary installation directory when using pnpm. This acts as a workspace boundary, preventing pnpm from searching up the directory tree and modifying the parent workspace's lockfile during ng update.
eb893b9 to
6b03257
Compare
|
This pull request has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Write an empty pnpm-workspace.yaml file inside the temporary installation directory when using pnpm. This acts as a workspace boundary, preventing pnpm from searching up the directory tree and modifying the parent workspace's lockfile during ng update.